package com.heima.admin.job;

import com.heima.admin.service.WemediaNewsScanService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class WemediaNewsAutoScanJob {
    @Autowired
    private WemediaNewsScanService wemediaNewsScanService;
    /**
     * 任务方法
     */
    @XxlJob("wenmediaAutoScanJob")
    public ReturnT<String> scanNewsJob(String param) throws Exception {
        log.info("文章定时发布任务执行 {}");
        //定时发布文章
        wemediaNewsScanService.schedulePublishNews();
        return ReturnT.SUCCESS;
    }

}
